home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / tar.zip / TAR.DOC < prev    next >
Text File  |  1990-08-23  |  26KB  |  539 lines

  1. .nf
  2. TAR(1)                   USER COMMANDS                     TAR(1)
  3.  
  4. NAME
  5.      tar - tape (or other media) file archiver
  6.  
  7. SYNOPSIS
  8.      tar -[BcdDhiklmopRstvxzZ] [-b N] [-f F] [-T F] [ filename or
  9.      regexp ...  ]
  10.  
  11. DESCRIPTION
  12.      tar provides a  way  to  store  many  files  into  a  single
  13.      archive,  which  can be kept in another Unix file, stored on
  14.      an I/O device such as tape, floppy, cartridge, or disk, sent
  15.      over  a  network, or piped to another program.  It is useful
  16.      for making backup copies, or for packaging up a set of files
  17.      to move them to another system.
  18.  
  19.      tar has existed  since  Version  7  Unix  with  very  little
  20.      change.   It  has  been  proposed as the standard format for
  21.      interchange of files among systems that conform to the  IEEE
  22.      P1003 ``Portable Operating System'' standard.
  23.  
  24.      This version of tar supports some of  the  extensions  which
  25.      were  proposed in the P1003 draft standards, including owner
  26.      and group names, and support for named  pipes,  fifos,  con-
  27.      tiguous files, and block and character devices.
  28.  
  29.      When reading an archive, this version of tar continues after
  30.      finding an error.  Previous versions required the `i' option
  31.      to ignore checksum errors.
  32.  
  33. OPTIONS
  34.      tar options can be specified in either  of  two  ways.   The
  35.      usual  Unix conventions can be used: each option is preceded
  36.      by `-'; arguments  directly  follow  each  option;  multiple
  37.      options  can be combined behind one `-' as long as they take
  38.      no arguments.  For compatability with the Unix tar  program,
  39.      the options may also be specified as ``keyletters,'' wherein
  40.      all the option letters occur in the first argument  to  tar,
  41.      with  no  `-',  and  their  arguments,  if any, occur in the
  42.      second, third, ...  arguments.  Examples:
  43.  
  44.      Normal:  tar -f arcname -cv file1 file2
  45.  
  46.      Old:  tar fcv arcname file1 file2
  47.  
  48.      At least one of the -c,  -t,  -d,  or  -x  options  must  be
  49.      included.  The rest are optional.
  50.  
  51.      Files to be operated upon are specified by a  list  of  file
  52.      names,  which  follows  the option specifications (or can be
  53.      read from a file by the -T option).  Specifying a  directory
  54.      name  causes that directory and all the files it contains to
  55.      be  (recursively)  processed.   If  a  full  path  name   is
  56.      specified  when  creating  an archive, it will be written to
  57.      the archive without the initial "/", to allow the  files  to
  58.      be  later  read  into a different place than where they were
  59.      dumped from, and a warning will be printed.   If  files  are
  60.      extracted  from  an  archive which contains full path names,
  61.      they will be extracted relative to the current directory and
  62.      a warning message printed.
  63.  
  64.      When extracting or listing files,  the  ``file  names''  are
  65.      treated as regular expressions, using mostly the same syntax
  66.      as the shell.  The shell  actually  matches  each  substring
  67.      between  ``/''s  separately,  while  tar  matches the entire
  68.      string at once, so some anomalies will occur; e.g. ``*''  or
  69.      ``?'' can match a ``/''.  To specify a regular expression as
  70.      an argument to tar, quote it so the shell  will  not  expand
  71.      it.
  72.  
  73.      -b N Specify a blocking factor for the archive.   The  block
  74.           size  will  be  N x 512 bytes.  Larger blocks typically
  75.           run faster and let you fit more data on  a  tape.   The
  76.           default  blocking  factor  is set when tar is compiled,
  77.           and is typically 20.  There is no limit to the  maximum
  78.           block  size,  as long as enough memory can be allocated
  79.           for it, and  as  long  as  the  device  containing  the
  80.           archive can read or write that block size.
  81.  
  82.      -B   When reading an archive, reblock  it  as  we  read  it.
  83.           Normally,  tar  reads  each block with a single read(2)
  84.           system call.  This does not work when  reading  from  a
  85.           pipe  or  network  socket  under Berkeley Unix; read(2)
  86.           only gives as much data as has arrived at  the  moment.
  87.           With  this option, it will do multiple read(2)s to fill
  88.           out to a record  boundary,  rather  than  reporting  an
  89.           error.   This option is default when reading an archive
  90.           from standard input, or over a network.
  91.  
  92.      -c   Create an archive from a list of files.
  93.  
  94.      -d   Diff an archive against the files in the  file  system.
  95.           Reports  differences  in file size, mode, uid, gid, and
  96.           contents.  If a file exists on the tape, but not in the
  97.           file  system,  that  is  reported.   This  option needs
  98.           further work to be really useful.
  99.  
  100.      -D   When creating an  archive,  only  dump  each  directory
  101.           itself;  don't dump all the files inside the directory.
  102.           In conjunction with find(1), this is useful in creating
  103.           incremental  dumps  for  archival  backups,  similar to
  104.           those produced by dump(8).
  105.  
  106.      -f F Specify the filename of the archive.  If the  specified
  107.           filename  is  ``-'',  the  archive  is  read  from  the
  108.           standard input or written to the standard  output.   If
  109.           the -f option is not used, and the environment variable
  110.           TAPE exists, its  value  will  be  used;  otherwise,  a
  111.           default  archive  name  (which  was picked when tar was
  112.           compiled) is used.  The default is normally set to  the
  113.           ``first''  tape drive or other transportable I/O medium
  114.           on the system.
  115.  
  116.           If the filename contains a colon before a slash, it  is
  117.           interpreted  as  a  ``hostname:/file/name''  pair.  tar
  118.           will invoke the commands  rsh  and  dd  to  access  the
  119.           specified  file  or  device on the system hostname.  If
  120.           you need to do something unusual like rsh with  a  dif-
  121.           ferent user name, use ``-f -'' and pipe it to rsh manu-
  122.           ally.
  123.  
  124.      -h   When creating an archive, if a symbolic link is encoun-
  125.           tered,  dump  the file or directory to which it points,
  126.           rather than dumping it as a symbolic link.
  127.  
  128.      -i   When reading an archive, ignore blocks of zeros in  the
  129.           archive.   Normally  a block of zeros indicates the end
  130.           of the archive, but in a damaged archive, or one  which
  131.           was  created by appending several archives, this option
  132.           allows tar to  continue.   It  is  not  on  by  default
  133.           because  there  is  garbage  written  after  the zeroed
  134.           blocks by the Unix tar program.  Note  that  with  this
  135.           option set, tar will read all the way to the end of the
  136.           file, eliminating problems with multi-file tapes.
  137.  
  138.      -k   When extracting files from an  archive,  keep  existing
  139.           files,  rather  than  overwriting them with the version
  140.           from the archive.
  141.  
  142.      -l   When dumping the contents of a directory to an archive,
  143.           stay  within  the  local file system of that directory.
  144.           This option only affects the files dumped because  they
  145.           are  in  a dumped directory; files named on the command
  146.           line are always dumped, and they can  be  from  various
  147.           file  systems.  This is useful for making ``full dump''
  148.           archival backups of a file system, as with the  dump(8)
  149.           command.   Files  which  are skipped due to this option
  150.           are mentioned on the standard error.
  151.  
  152.      -m   When extracting files from an archive, set each  file's
  153.           modified  timestamp  to  the  current time, rather than
  154.           extracting each  file's  modified  timestamp  from  the
  155.           archive.
  156.  
  157.      -o   When creating an archive, write an old format  archive,
  158.           which  does  not include information about directories,
  159.           pipes, fifos, contiguous files, or  device  files,  and
  160.           specifies file ownership by uid's and gid's rather than
  161.           by user names  and  group  name